<template>
	<view class="detail-view">
		<view class="top-bar"><uni-navbar :fixed="true" :back="true" color="#fff" title="问题详情"></uni-navbar></view>

		<view class="detail-info" v-show="clueInfo.id">
			<!-- <view class="com-h2"><text class="text">提交信息</text></view> -->
			<view class="form-box">
				<u-form>
					<u-form-item class="form-item" label="标题">
						<!-- block -->
						<view class="input-text">{{ clueInfo.title }}</view>
					</u-form-item>
					<u-form-item class="form-item" label="提交人">
						<!-- block -->
						<view class="input-text">{{ clueInfo.submitUser }}</view>
					</u-form-item>
					<u-form-item class="form-item" label="提交时间">
						<!-- block -->
						<view class="input-text">{{ clueInfo.submitTime || $parseTime(clueInfo.createTime, '{y}-{m}-{d}') }}</view>
					</u-form-item>

					<u-form-item class="form-item" label="手机号">
						<!-- block -->
						<view class="input-text">{{ clueInfo.phone }}</view>
					</u-form-item>
					<u-form-item class="form-item" label="问题地点">
						<!-- block -->
						<view class="input-text">{{ clueInfo.address }}</view>
					</u-form-item>
					<u-form-item class="form-item" label="正文内容" label-position="top">
						<!-- block -->
						<view class="text-l" v-html="clueInfo.content"></view>
					</u-form-item>
				</u-form>
			</view>

			<!-- <view class="img-box" v-if="fileList.length > 0">
				<view class="img-item" v-for="(item, index) in fileList" :key="index" @click="$showLine(item)"><image class="image" :src="$imagePreview(item.path)" mode="aspectFill" @click="previewImage(fileList, index)"></image></view>
			</view> -->
			<view class="file-list" v-if="fileList1.length > 0">
				<view>附件:</view>
				<view class="file-item" v-for="(item, index) in fileList1" :key="index" @click="$showLine(item)">
					<view class="file-name clamp">{{ item.name }}</view>
					<view class="right-type">预览</view>
				</view>
			</view>

			<block v-if="['wait'].indexOf(clueInfo.nodeStatus) == -1">
				<view class="com-h2"><text class="text">问题处理</text></view>
				<view class="form-box form-box-show">
					<u-form>
						<u-form-item class="form-item" label="处理类型">
							<view>{{ clueInfo.handleResultName }}</view>
						</u-form-item>
						<u-form-item class="form-item" label="处理备注">
							<view>{{ clueInfo.handleInfo }}</view>
						</u-form-item>
						<u-form-item class="form-item" label="处理人">
							<view>{{ clueInfo.handleUser }}</view>
						</u-form-item>
						<u-form-item class="form-item" label="处理时间">
							<view>{{ clueInfo.handleTime }}</view>
						</u-form-item>
					</u-form>
				</view>

				<block v-if="clueInfo.jiedaoResult == '21'">
					<view class="com-h2"><text class="text">街道人大工作室处理</text></view>
					<view class="form-box form-box-show">
						<u-form>
							<u-form-item class="form-item" label="处理类型">
								<view>{{ clueInfo.jiedaoResultName }}</view>
							</u-form-item>
							<u-form-item class="form-item" label="办理答复">
								<view>{{ clueInfo.jiedaoInfo }}</view>
							</u-form-item>
							<u-form-item class="form-item" label="处理人">
								<view>{{ clueInfo.jiedaoUser }}</view>
							</u-form-item>
							<u-form-item class="form-item" label="处理时间">
								<view>{{ clueInfo.jiedaoTime }}</view>
							</u-form-item>

							<view class="file-list" v-if="fileList2.length > 0">
								<view>附件:</view>
								<view class="file-item" v-for="(item, index) in fileList2" :key="index" @click="$showLine(item)">
									<view class="file-name clamp">{{ item.name }}</view>
									<view class="right-type">预览</view>
								</view>
							</view>
						</u-form>
					</view>
				</block>

				<block v-if="clueInfo.rdgwResult == '3'">
					<view class="com-h2"><text class="text">人代工委处理</text></view>
					<view class="form-box form-box-show">
						<u-form>
							<u-form-item class="form-item" label="处理类型">
								<view>{{ clueInfo.rdgwResultName }}</view>
							</u-form-item>
							<u-form-item class="form-item" label="办理单位">
								<view>{{ clueInfo.transactDeptName }}</view>
							</u-form-item>
							<u-form-item class="form-item" label="处理备注">
								<view>{{ clueInfo.rdgwInfo }}</view>
							</u-form-item>
							<u-form-item class="form-item" label="处理人">
								<view>{{ clueInfo.rdgwUser }}</view>
							</u-form-item>
							<u-form-item class="form-item" label="处理时间">
								<view>{{ clueInfo.rdgwTime }}</view>
							</u-form-item>
						</u-form>
					</view>
				</block>
			</block>

			<block v-if="clueInfo.transactBack == '1' && clueInfo.nodeStatus != 'confirm'">
				<view class="com-h2"><text class="text">人代工委确认</text></view>
				<view class="form-box form-box-show">
					<u-form>
						<u-form-item class="form-item" label="是否确认">
							<view>{{ clueInfo.transactBackName || '重新办理' }}</view>
						</u-form-item>
						<u-form-item class="form-item" label="处理备注">
							<view>{{ clueInfo.finishInfo }}</view>
						</u-form-item>
						<u-form-item class="form-item" label="处理人">
							<view>{{ clueInfo.finishUser }}</view>
						</u-form-item>
						<u-form-item class="form-item" label="处理时间">
							<view>{{ clueInfo.finishTime }}</view>
						</u-form-item>
					</u-form>
				</view>
			</block>

			<block v-if="clueInfo.rdgwResult != '3' && ['confirm', 'end'].indexOf(clueInfo.nodeStatus) > -1">
				<view class="com-h2" v-if="clueInfo.rdgwResult == 'gw'"><text class="text">人代工委办理</text></view>
				<view class="com-h2" v-else-if="clueInfo.jiedaoResult == 'jiedao'"><text class="text">街道人大工作室办理</text></view>
				<view class="com-h2" v-else><text class="text">问题办理</text></view>
				<view class="form-box form-box-show">
					<u-form>
						<u-form-item class="form-item" label="处理类型">
							<view>{{ clueInfo.rdgwResultName || clueInfo.jiedaoResultName || clueInfo.handleResultName }}</view>
						</u-form-item>
						<u-form-item class="form-item" label="办理答复">
							<view>{{ clueInfo.transactInfo }}</view>
						</u-form-item>
						<u-form-item class="form-item" label="处理人">
							<view>{{ clueInfo.transactUser }}</view>
						</u-form-item>
						<u-form-item class="form-item" label="处理时间">
							<view>{{ clueInfo.transactTime }}</view>
						</u-form-item>

						<view class="file-list" v-if="fileList2.length > 0">
							<view>附件:</view>
							<view class="file-item" v-for="(item, index) in fileList2" :key="index" @click="$showLine(item)">
								<view class="file-name clamp">{{ item.name }}</view>
								<view class="right-type">预览</view>
							</view>
						</view>
					</u-form>
				</view>
			</block>

			<block v-if="clueInfo.rdgwResult == '3' && ['confirm', 'end'].indexOf(clueInfo.nodeStatus) > -1">
				<view class="com-h2"><text class="text">办理单位办理</text></view>
				<view class="form-box form-box-show">
					<u-form>
						<u-form-item class="form-item" label="办理答复">
							<view>{{ clueInfo.transactInfo }}</view>
						</u-form-item>
						<u-form-item class="form-item" label="处理人">
							<view>{{ clueInfo.transactUser }}</view>
						</u-form-item>
						<u-form-item class="form-item" label="处理时间">
							<view>{{ clueInfo.transactTime }}</view>
						</u-form-item>

						<view class="file-list" v-if="fileList2.length > 0">
							<view>附件:</view>
							<view class="file-item" v-for="(item, index) in fileList2" :key="index" @click="$showLine(item)">
								<view class="file-name clamp">{{ item.name }}</view>
								<view class="right-type">预览</view>
							</view>
						</view>
					</u-form>
				</view>
			</block>

			<block v-if="clueInfo.transactBack == '0' && clueInfo.nodeStatus != 'confirm'">
				<view class="com-h2"><text class="text">人代工委确认</text></view>
				<view class="form-box form-box-show">
					<u-form>
						<u-form-item class="form-item" label="是否确认">
							<view>{{ clueInfo.transactBackName || '已确认' }}</view>
						</u-form-item>
						<u-form-item class="form-item" label="处理备注">
							<view>{{ clueInfo.finishInfo }}</view>
						</u-form-item>
						<u-form-item class="form-item" label="处理人">
							<view>{{ clueInfo.finishUser }}</view>
						</u-form-item>
						<u-form-item class="form-item" label="处理时间">
							<view>{{ clueInfo.finishTime }}</view>
						</u-form-item>
					</u-form>
				</view>
			</block>

			<block v-if="clueInfo.nodeStatus == 'wait' && $sysBtns('msjdb_wait_chuli')">
				<view class="com-h2"><text class="text">问题处理</text></view>
				<view class="form-box">
					<u-form :model="form">
						<u-form-item class="form-item" required label="处理类型" label-width="150" prop="type">
							<u-radio-group v-model="type" @change="typeGroupChange" :key="type">
								<u-radio v-for="(item, index) in typeList" :key="index" :name="item.name" width="260">{{ item.label }}</u-radio>
							</u-radio-group>
						</u-form-item>
						<u-form-item class="form-item" label="问题备注" label-position="top">
							<!-- block -->
							<u-input inputAlign="left" v-model="form.opinion" type="textarea" placeholder="请输入问题备注" :clearable="false" :height="160" :maxlength="-1" />
						</u-form-item>
					</u-form>
				</view>

				<view class="fiexd-btm"><u-button class="form-btn" type="error" @click="confirm">提交</u-button></view>
			</block>

			<block v-if="['1'].indexOf(clueInfo.nodeStatus) > -1 && $sysBtns('msjdb_1_banjie')">
				<view class="com-h2"><text class="text">问题办理</text></view>
				<view class="form-box">
					<u-form :model="form">
						<u-form-item class="form-item" required label="办理答复" label-position="top">
							<!-- block -->
							<u-input inputAlign="left" v-model="form.opinion" type="textarea" placeholder="请输入办理答复" :clearable="false" :height="160" :maxlength="-1" />
						</u-form-item>
						<u-form-item class="form-item " label="" label-position="top">
							<!-- block -->
							<uni-file-upload :type="['all', 'image', 'audio']" :limit="10"></uni-file-upload>
						</u-form-item>
					</u-form>
				</view>

				<view class="fiexd-btm"><u-button class="form-btn" type="error" @click="confirm1">提交</u-button></view>
			</block>

			<block v-if="['2'].indexOf(clueInfo.nodeStatus) > -1 && $sysBtns('msjdb_2_chuli')">
				<view class="com-h2"><text class="text">街道人大工作室处理</text></view>
				<view class="form-box">
					<u-form :model="form">
						<u-form-item class="form-item" required label="处理类型" label-width="150" prop="deal">
							<u-radio-group v-model="deal" @change="dealGroupChange" :key="deal">
								<u-radio v-for="(item, index) in dealList" :key="index" :name="item.name" width="260">{{ item.label }}</u-radio>
							</u-radio-group>
						</u-form-item>
						<u-form-item class="form-item" required label="办理答复" label-position="top">
							<!-- block -->
							<u-input inputAlign="left" v-model="form.opinion" type="textarea" placeholder="请输入办理答复" :clearable="false" :height="160" :maxlength="-1" />
						</u-form-item>
						<u-form-item class="form-item " label="" label-position="top">
							<!-- block -->
							<uni-file-upload :type="['all', 'image', 'audio']" :limit="10"></uni-file-upload>
						</u-form-item>
					</u-form>
				</view>

				<view class="fiexd-btm" v-if="form.deal == '21'"><u-button class="form-btn" type="error" @click="confirm2">提交</u-button></view>
				<view class="fiexd-btm" v-else><u-button class="form-btn" type="error" @click="confirm3">提交</u-button></view>
			</block>

			<block v-if="['21'].indexOf(clueInfo.nodeStatus) > -1 && $sysBtns('msjdb_21_chuli')">
				<view class="com-h2"><text class="text">人代工委处理</text></view>
				<view class="form-box">
					<u-form :model="form">
						<u-form-item class="form-item" required label="处理类型" label-width="150" prop="handle">
							<u-radio-group v-model="handle" @change="handleGroupChange" :key="handle">
								<u-radio v-for="(item, index) in handleList" :key="index" :name="item.name" width="260">{{ item.label }}</u-radio>
							</u-radio-group>
						</u-form-item>
						<block v-if="form.handle == '3'">
							<u-form-item class="form-item" required label="办理单位">
								<u-input v-model="dept" type="select" :select-open="deptShow" placeholder="请选择类型" @click="deptShow = true" />
								<u-select :list="deptList" v-model="deptShow" @confirm="deptConfirm"></u-select>
							</u-form-item>
							<u-form-item class="form-item" label="处理备注" label-position="top">
								<!-- block -->
								<u-input inputAlign="left" v-model="form.opinion" type="textarea" placeholder="请输入处理备注" :clearable="false" :height="160" :maxlength="-1" />
							</u-form-item>
						</block>
						<block v-else>
							<u-form-item class="form-item" required label="办理答复" label-position="top">
								<!-- block -->
								<u-input inputAlign="left" v-model="form.opinion" type="textarea" placeholder="请输入办理答复" :clearable="false" :height="160" :maxlength="-1" />
							</u-form-item>
							<u-form-item class="form-item " label="" label-position="top">
								<!-- block -->
								<uni-file-upload :type="['all', 'image', 'audio']" :limit="10"></uni-file-upload>
							</u-form-item>
						</block>
					</u-form>
				</view>

				<view class="fiexd-btm" v-if="form.handle == '3'"><u-button class="form-btn" type="error" @click="confirm4">提交</u-button></view>
				<view class="fiexd-btm" v-else><u-button class="form-btn" type="error" @click="confirm5">提交</u-button></view>
			</block>

			<block v-if="['3'].indexOf(clueInfo.nodeStatus) > -1 && $sysBtns('msjdb_3_banli')">
				<view class="com-h2"><text class="text">问题办理</text></view>
				<view class="form-box">
					<u-form :model="form">
						<u-form-item class="form-item" required label="办理答复" label-position="top">
							<!-- block -->
							<u-input inputAlign="left" v-model="form.opinion" type="textarea" placeholder="请输入办理答复" :clearable="false" :height="160" :maxlength="-1" />
						</u-form-item>
						<u-form-item class="form-item " label="" label-position="top">
							<!-- block -->
							<uni-file-upload :type="['all', 'image', 'audio']" :limit="10"></uni-file-upload>
						</u-form-item>
					</u-form>
				</view>

				<view class="fiexd-btm"><u-button class="form-btn" type="error" @click="confirm1">提交</u-button></view>
			</block>

			<block v-if="clueInfo.nodeStatus == 'confirm' && $sysBtns('msjdb_confirm_banjie')">
				<view class="com-h2"><text class="text">人代工委确认</text></view>
				<view class="form-box">
					<u-form :model="form">
						<u-form-item class="form-item" required label="是否确认" label-width="150" prop="transact">
							<u-radio-group v-model="transact" @change="transactGroupChange" :key="transact">
								<u-radio v-for="(item, index) in transactList" :key="index" :name="item.name" width="260">{{ item.label }}</u-radio>
							</u-radio-group>
						</u-form-item>
						<u-form-item class="form-item" label="处理备注" label-position="top">
							<!-- block -->
							<u-input inputAlign="left" v-model="form.opinion" type="textarea" placeholder="请输入处理备注" :clearable="false" :height="160" :maxlength="-1" />
						</u-form-item>
					</u-form>
				</view>

				<view class="fiexd-btm"><u-button class="form-btn" type="error" @click="confirm6">提交</u-button></view>
			</block>
		</view>

		<view v-if="false"></view>
	</view>
</template>

<script>
import uniFileUpload from '@/components/uni-file-uploader.vue';
import uniParse from '@/components/uni-parse/parse.vue';
import selectTree from '@/components/uni-select-tree.vue';
import { mapState } from 'vuex';
export default {
	components: {
		uniFileUpload,
		uniParse,
		selectTree
	},
	data() {
		return {
			statusMap: {
				0: '所有',
				1: '待审核',
				2: '办理中',
				3: '已答复',
				4: '已办结',
				5: '不予受理'
			},

			type: '',
			typeShow: false,
			typeList: [],

			handle: '',
			handleShow: false,
			handleList: [],

			deal: '',
			dealShow: false,
			dealList: [],

			transact: '',
			transactShow: false,
			transactList: [],

			dept: '',
			deptShow: false,
			deptList: [],

			fileList1: [],
			fileList2: [],

			id: '',
			clueInfo: {},
			form: {
				deptId: '',
				type: '',
				transact: '',
				deal: '',
				handle: '',
				opinion: ''
			},
			rules: {
				type: [
					{
						required: true,
						message: '请选择处理类型',
						trigger: 'change'
					}
				],
				handle: [
					{
						required: true,
						message: '请选择处理类型',
						trigger: 'change'
					}
				],
				transact: [
					{
						required: true,
						message: '请选择是否确认',
						trigger: 'change'
					}
				],
				pass: [
					{
						required: true,
						message: '请选择办理意见',
						trigger: 'change'
					}
				],
				opinion: [
					{
						required: true,
						message: '请输入处理结果',
						trigger: 'change'
					}
				]
			},
			key: -1,
			play: false
		};
	},
	onLoad(option) {
		this.loadLogin();
		this.id = option.id;
		if (option && option.type) {
			this.type = option.type;
		}

		this.loadDictType('represent_type', 'typeList');
		this.loadDict('jiedao_deal_type', 'dealList');
		this.loadDict('rdgw_type', 'handleList');
		this.loadDict('represent_confirm', 'transactList');
		this.loadDept();
		this.loadData();
	},
	onHide() {
		this.$ttsOff();
	},
	onUnload() {
		this.$ttsOff();
		this.$store.commit('filePush', []);
	},
	computed: {
		...mapState(['userInfo', 'fileList'])
	},
	methods: {
		loadLogin() {
			if (this.userInfo.sysUser) {
				this.clientCode = this.userInfo.sysUser.clientCode;
				this.userId = this.userInfo.sysUser.id;
				this.userName = this.userInfo.sysUser.userName;
			} else {
				// this.$logout();
			}
		},
		loadDictType(type, list) {
			this.$request('/system/sys-dict/dictList', {
				clientCode: this.clientCode,
				sysDict: {
					dictType: type,
					remark: 'type'
				}
			}).then((res) => {
				if (!res.data) {
					return false;
				}
				this[list] = [];
				res.data.forEach((item) => {
					this[list].push({
						name: item.dictValue,
						value: item.dictValue,
						label: item.dictName
					});
				});
			});
		},
		loadDict(type, list, value) {
			this.$request('/system/sys-dict/dictList', {
				clientCode: this.clientCode,
				sysDict: {
					dictType: type
				}
			}).then((res) => {
				if (!res.data) {
					return false;
				}
				this[list] = [];
				res.data.forEach((item) => {
					this[list].push({
						name: item.dictValue,
						value: item.dictValue,
						label: item.dictName
					});
				});
			});
		},
		loadDept() {
			this.$request('/system/sys-dept/depts', {
				clientCode: this.clientCode,
				remark: 'msjdb_bldw'
			}).then((res) => {
				if (!res.data) {
					return false;
				}
				this.deptList = [];
				res.data.forEach((item) => {
					this.deptList.push({
						id: item.id,
						value: item.id,
						label: item.deptName,
						name: item.deptName
					});
				});
			});
		},
		loadData() {
			this.$request('/lvzhitong/represent/query/' + this.id, {
				id: this.id,
				userId: this.userId
			}).then((res) => {
				if (!res.data) {
					this.$msg('暂无数据');
					return false;
				}
				this.fileList1 = res.data.fileList;
				this.fileList2 = res.data.fileList2;
				this.clueInfo = res.data.represent;
			});
		},
		typeConfirm(e) {
			this.type = e[0].label;
			this.form.type = e[0].value;
		},
		typeGroupChange(e) {
			this.type = e;
			this.form.type = e;
		},
		dealConfirm(e) {
			this.deal = e[0].label;
			this.form.deal = e[0].value;
		},
		dealGroupChange(e) {
			this.deal = e;
			this.form.deal = e;
		},
		handleConfirm(e) {
			this.handle = e[0].label;
			this.form.handle = e[0].value;
		},
		handleGroupChange(e) {
			this.handle = e;
			this.form.handle = e;
		},
		transactConfirm(e) {
			this.transact = e[0].label;
			this.form.transact = e[0].value;
		},
		transactGroupChange(e) {
			this.transact = e;
			this.form.transact = e;
		},
		deptConfirm(e) {
			this.dept = e[0].label;
			this.form.deptId = e[0].value;
		},
		confirm() {
			let data = {};
			data = {
				userId: this.userId,
				role: this.roleCodes,
				represent: {
					id: this.id,
					handleUser: this.userName,
					handleResult: this.form.type,
					handleInfo: this.form.opinion
				}
			};

			if (!data.represent.handleResult) {
				this.$msg('请选择处理类型');
				return false;
			}
			// if (!data.represent.handleInfo) {
			// 	this.$msg('请输入问题备注');
			// 	return false;
			// }

			let url = '/lvzhitong/represent/handle';
			this.$request(url, data, {
				load: true
			}).then((res) => {
				this.$msg(res.msg);
				this.navigateBack();
			});
		},
		confirm1() {
			let data = {};
			data = {
				userId: this.userId,
				role: this.roleCodes,
				represent: {
					id: this.id,
					transactUser: this.userName,
					transactInfo: this.form.opinion
				},
				fileList2: this.fileList
			};

			if (!data.represent.transactInfo) {
				this.$msg('请输入办理答复');
				return false;
			}

			let url = '/lvzhitong/represent/transact';
			this.$request(url, data, {
				load: true
			}).then((res) => {
				this.$msg(res.msg);
				this.navigateBack();
			});
		},
		confirm2() {
			let data = {};
			data = {
				userId: this.userId,
				role: this.roleCodes,
				represent: {
					id: this.id,
					jiedaoResult: this.form.deal,
					jiedaoUser: this.userName,
					jiedaoInfo: this.form.opinion
				}
			};

			if (!data.represent.jiedaoResult) {
				this.$msg('请选择处理类型');
				return false;
			}
			// if (!data.represent.jiedaoInfo) {
			// 	this.$msg('请输入处理备注');
			// 	return false;
			// }

			let url = '/lvzhitong/represent/jiedao_handle';
			this.$request(url, data, {
				load: true
			}).then((res) => {
				this.$msg(res.msg);
				this.navigateBack();
			});
		},
		confirm3() {
			let data = {};
			data = {
				userId: this.userId,
				role: this.roleCodes,
				represent: {
					id: this.id,
					jiedaoResult: this.form.deal,
					transactUser: this.userName,
					transactInfo: this.form.opinion
				},
				fileList2: this.fileList
			};

			if (!data.represent.jiedaoResult) {
				this.$msg('请选择处理类型');
				return false;
			}
			if (!data.represent.transactInfo) {
				this.$msg('请输入办理答复');
				return false;
			}

			let url = '/lvzhitong/represent/transact';
			this.$request(url, data, {
				load: true
			}).then((res) => {
				this.$msg(res.msg);
				this.navigateBack();
			});
		},
		confirm4() {
			let data = {};
			data = {
				userId: this.userId,
				role: this.roleCodes,
				represent: {
					id: this.id,
					transactDept: this.form.deptId,
					rdgwResult: this.form.handle,
					rdgwUser: this.userName,
					rdgwInfo: this.form.opinion
				}
			};

			if (!data.represent.rdgwResult) {
				this.$msg('请选择处理类型');
				return false;
			}
			if (!data.represent.transactDept) {
				this.$msg('请选择办理单位');
				return false;
			}
			// if (!data.represent.rdgwInfo) {
			// 	this.$msg('请输入处理备注');
			// 	return false;
			// }

			let url = '/lvzhitong/represent/rdgw_handle';
			this.$request(url, data, {
				load: true
			}).then((res) => {
				this.$msg(res.msg);
				this.navigateBack();
			});
		},
		confirm5() {
			let data = {};
			data = {
				userId: this.userId,
				role: this.roleCodes,
				represent: {
					id: this.id,
					rdgwResult: this.form.handle,
					transactUser: this.userName,
					transactInfo: this.form.opinion
				},
				fileList2: this.fileList
			};

			if (!data.represent.rdgwResult) {
				this.$msg('请选择处理类型');
				return false;
			}
			if (!data.represent.transactInfo) {
				this.$msg('请输入办理答复');
				return false;
			}

			let url = '/lvzhitong/represent/transact';
			this.$request(url, data, {
				load: true
			}).then((res) => {
				this.$msg(res.msg);
				this.navigateBack();
			});
		},
		confirm6() {
			let data = {};
			data = {
				userId: this.userId,
				role: this.roleCodes,
				represent: {
					id: this.id,
					transactBack: this.form.transact,
					finishUser: this.userName,
					finishInfo: this.form.opinion
				}
			};

			if (!data.represent.transactBack) {
				this.$msg('请选择是否确认');
				return false;
			}
			// if (!data.represent.finishInfo) {
			// 	this.$msg('请输入处理备注');
			// 	return false;
			// }

			let url = '/lvzhitong/represent/finish';
			this.$request(url, data, {
				load: true
			}).then((res) => {
				this.$msg(res.msg);
				this.navigateBack();
			});
		},
		back(e) {
			this.navigateBack();
		},
		navigateBack(e) {
			setTimeout(() => {
				let pre = this.$prePage();
				if (pre && pre.loadData) {
					pre.loadData('refresh');
				}
				uni.navigateBack();
			}, 500);
		},
		call(e) {
			uni.makePhoneCall({
				phoneNumber: e
			});
		},
		previewImage(list, idx) {
			let urls = [];
			list.forEach((item) => {
				urls.push(this.$imagePreview(item.path));
			});
			uni.previewImage({
				current: idx,
				urls: urls
			});
		}
	}
};
</script>

<style lang="scss">
.detail-view {
	background-color: #fff;
}

.detail-info {
	padding: 0;

	.overflow {
		padding: 20rpx 30rpx;
	}
}

.img-box {
	padding: 20rpx 30rpx 0;
	display: flex;
	flex-wrap: wrap;

	.image {
		padding: 0 20rpx 20rpx 0;
		width: 160rpx;
		height: 160rpx;
	}
}

.form-box {
	.form-item {
		@include mp-flex;
		// border-bottom: 20rpx solid #f5f7fa;

		.input-text {
			padding: 11rpx 0;
			line-height: 48rpx;
			text-align: right;
		}

		.text-l {
			width: 100%;
			white-space: pre-line;
			text-align: left;
		}
	}
}

.fiexd-btm {
	position: static;
	padding: 30rpx;
}
</style>
